package com.itrip.dto;

import com.alibaba.fastjson.JSON;
import com.itrip.vo.ItripTokenVO;
import com.itrip.vo.TempVO;

public class Dto<T>{
	private String success; //判断系统是否出错做出相应的true或者false的返回，与业务无关，出现的各种异常
	private String errorCode;//该错误码为自定义，一般0表示无错
	private String msg;//对应的提示信息
	private T data;//具体返回数据内容(entity、自定义VO、其他)
	
	public T getData() {
		return data;
	}
	public void setData(T data) {
		this.data = data;
	}
	public String getSuccess() {
		return success;
	}
	public void setSuccess(String success) {
		this.success = success;
	}
	public String getErrorCode() {
		return errorCode;
	}
	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}

	public static void main(String[] args) {
		Dto<ItripTokenVO> dto = new Dto<ItripTokenVO>();
		dto.setErrorCode("0");
		dto.setMsg("操作成功");
		dto.setSuccess("true");
		dto.setData(new ItripTokenVO(
				"token:PC-b9a523e8bcf31a2763a2d8a7d8d46c8d-58-20181211220909-450f59"
				,1544544543310L
				,1544537343310L));
//		dto.setData(new TempVO());
		String json = JSON.toJSONString(dto);
		System.out.println(json);
	}
	
}